
<!DOCTYPE html>
<html style="overflow-x:hidden;overflow-y:auto;">
	<head>
		<title>用户管理</title>
		<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
		<script src="/resources/jquery/jquery-1.9.1.min.js" type="text/javascript"></script>
		[#include "/admin/include/header.htm"]
		<script type="text/javascript">
			$(document).ready(function() {
				$("#inputForm").validate({
					rules: {
						userName: {remote: "/admin/admin/checkLoginName"},
						tel:{pattern:/^\d{3,4}-?\d{7,9}$/},
						email:{email2:true}
					},
					messages: {
						userName: {remote: "用户登录名已存在"},
						confirmNewPassword: {equalTo: "输入与上面相同的密码"},
						tel:{pattern:'电话格式不正确'},
						email:{email2:"非法email格式"}
					}
				});
			});
		</script>
	</head>
	<body>
		
	<ul class="nav nav-tabs">
		<li><a href="list">用户列表</a></li>
		<li class="active"><a href="javascript:;">用户修改</a></li>
	</ul><br/>
	
	<form id="inputForm" class="form-horizontal" action="update" method="post">
		<input id="id" name="id" type="hidden" value="${sysUser.id!}"/>
		<div class="control-group">
			<label class="control-label" for="userName"><span class="red-star">*</span>登录名:</label>
			<div class="controls">
				<input id="userName" name="userName" class="required userName" type="text" value="${sysUser.userName!}" minlength="2"  maxlength="50"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label" for="password"><span class="red-star">*</span>密码:</label>
			<div class="controls">
				<input id="password" name="password" type="password" class="required"  maxlength="50" minlength="6" class="" autocomplete="off"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label" for="confirmNewPassword"><span class="red-star">*</span>确认密码:</label>
			<div class="controls">
				<input id="confirmNewPassword" name="confirmNewPassword" type="password" value="" maxlength="50" minlength="6" equalTo="#password" autocomplete="off"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label" for="email">邮箱:</label>
			<div class="controls">
				<input id="email" name="email" class="email" type="text" value="${sysUser.email!}" maxlength="100"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label" for="tel">电话:</label>
			<div class="controls">
				<input id="tel" name="tel" class="required" type="text" value="${sysUser.tel!}"  maxlength="100"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label" for="roleIdList">用户角色:</label>
			<div class="controls">
					[#list sysRoles as role]
						[#list sysUser.sysRoles as sr]
							<span><input id="roleId${role.roleId!}" name="roleIds" class="" [#if role.roleId == sr.roleId] checked="checked" [/#if] type="radio" value="${role.roleId}"/><label for="roleId${role.roleId!}">${role.roleName}</label></span>
						[/#list]
					[/#list]
			</div>
		</div>
		<div class="form-actions">
			<input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
		</div>
	</form>
	</body>
</html>